<template>
	<view class="blue" :class="{'light':theme=='light'}">
		<view class="plr10 mb10 bgPart" style="min-height: 80vh;">
			<view class="mt10 pb100">
				<view class="mt10 flex column bdb_blue3 ptb5" v-for="(item,i) in logList" :key="i" v-if="logList.length>0">
					<view class="w100 ptb5">{{item.title}}</view>
					<view class="w100 ptb5 redColor" v-if="item.reply==null">{{$t('feed.noreply')}}</view>	
					<view class="w100 ptb5 " v-else>{{$t('feed.reply')}}: {{item.reply}}</view>	
					<view class="w100 ptb5 tr">{{item.created_at}}</view>
				</view>
				<view class="mt20 tc" v-if="logList.length==0">
					<image src="../../static/image/anonymous.png" class="wt60 h60" ></image>
					<view>{{$t('home.norecord')}}</view>
				</view>
			</view>
		</view>
		
		<view class="h50">
			
		</view>
	</view>
</template>

<script>
    import {mapState} from 'vuex'
	import uniPopup from '@/components/uni-popup.vue';
	export default{
		components: {
			uniPopup
		},
		data(){
			return {
				page:1,
				logList:[],
			}
		},
		onLoad() {
			this.$utils.setThemeTop(this.theme)
			uni.setNavigationBarTitle({
				title:this.$t('assets').record
			})
			this.getLog();
		},
		computed:{
		   ...mapState(['theme']),//获取当前UI颜色
		},
		methods:{
			getLog(){
				this.$utils.initDataToken({url:'feedback/list',type:'get', data:{page:this.page}},res=>{
					uni.stopPullDownRefresh()
					this.logList=this.logList.concat(res.data);
				})
			},
		},
		onPullDownRefresh() {
			this.page=1;
			this.logList=[];
			this.getLog();
		},
		onReachBottom() {
			this.page++;
			this.getLog();
		},
	}
</script>

<style>
	page {
		background-color: #102030;
		width: 100.0vw;
		height: 100.0vh;
		overflow-y: scroll;
	}
</style>
